Geist's Maps
code Tutorial's

Home

Tutorial's
code Tutorial's
downloads
info
Projects

Enter subhead content here

Enter content here

                                          Importing weapons from UT into DX
 

Hello again Geist here with another tutorial.This time I will show you how to import
 
weapons from any Unreal Engine game into Deus-Ex for use.This is a long,hard and
 
tedious process but with patience and skill you will have good things to show for your
 
time.I myself am not much of a coder,but I learned the hard way how to do this,so please
 
bear with.
 
    Ok first step would be getting a weapon.Say just for instance and the scope of this
 
tutorial you want to bring the "enforcer" from UT.So you first start by exporting the
 
enforcer using WOTexporter,export it to "unreal.3d" not "3ds" format.you will need to
 
export the 3 different types.there are "pickup" "third person" and a "player view"
 
meshes.Each ends up a pair of files one "a_3d" and one "d_3d".which makes a total of 6
 
files you should have.
 
    Now those files you need to convert to Deus-Ex format,or they will not even show up
 
ingame.The way to do that is to use unr2de mesh tool by Steve Tack.Make a folder in your
 
default hard drive,name it whatever you want( in mine it's "first" ) put unr2de.exe in that
 
folder and also put all 6 mesh files you are converting there too.Then from a dos command
 
prompt type C:/first/unr2de enforcer  ( note: "enforcer" is just an example just type after
 
unr2de whatever the name of your mesh is without the a or d 3d )
 
    The converter should run through a little process and both your a and d 3d files from
 
that one mesh will be ready for the next step.Now repeat the process for your other two
 
meshes and we can move on the hard part ;)
 
    Now begins the code I will not go over in this tutorial what you will put in code or what
 
you will put in default property's.You should already know how to do that part,if not your
 
wasting your time on this.I am going to show you how to use the #exec commands and
 
how to position the model in the players hands properly.
 
    You should already be familiar with how to set up a package,but for this one you will
 
do so like this put a "classes" as usual then a "models" and if need be a "sounds" you can
 
also put a "textures" but it is easier to just put your textures in the "models" folder.Ok with
 
that done make your new class uc "enforcer" or whatever and just after the class
 
declaration and variable declarations type in the #exec commands like so
 
// player view version
#exec MESH IMPORT MESH=Enforcer ANIVFILE=MODELS\Enforcer_a.3d
 
DATAFILE=MODELS\Enforcer_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=Enforcer X=0 Y=0 Z=0 pitch=0 yaw=0 roll=0
 
There is 1 statement like this for each of the 3 models ( pickup,first person,and third person
 
)
 

Now the pain in the ass is going to be the X,Y,Z and pitch,yaw,roll statements above.Listen
 
carefully to what I am about to say.I left them at zero here,but YOU must tweak them by
 
the tedious process of trial and error going back from compiling the mod to testing in
 
editor and checking the way it looks and is turned. the x,y, and z are axis points and are a
 
pain to understand and fix( unless you were the actual modeler ) but it will pay off when
 
you get it right,For instance in my weapon mod "tactical" it took me about 3 hours or so to
 
code the weapons,but it took me two weeks to get the proper positioning on all the guns.
 
    Now also before I go to the animation part,I have to explain another pesky obsticle,the
 
meshmap and scale.
 
#exec MESHMAP NEW   MESHMAP=Enforcer MESH=Enforcer
#exec MESHMAP SCALE MESHMAP=Enforcer X=0.0 Y=0.0 Z=0.0
 
Again I left this blank because you need to tweak it yourself.This is the scale of how big
 
the model will be in game.Again there is 1 statement like this for each of the 3 models (
 
pickup,first person,and third person ).This statement comes after the animation statements
 
but before the texture declarations.
 
 Ok that wasn't too bad now was it?
 
 Now to properly get everything working you must use logic,name things a specific name
 
and do not forget that name.This is vital.I will put a total "example" below as a simple
 
template.
 

Now for the animation part.Now using the original import codes ( this can be tricky if your
 
ripping the weapons from a mod ) The import codes can be found in all the UT's uc files of
 
each weapon luckily.But if you want to say use tactical op's or INF's weapons your going
 
to have to search.
 
   Using these as a reference we must input the proper animation frames for each
 
function.This is also a pain in the ass because Unreal and UT use different statements that
 
Deus-Ex.Just use the basic DX ones and you will be fine,it takes some tooling with,but you
 
can do it.
 
   Here is an example of the animation handling in first person.Now this is the only mode
 
you will have animation in.
 
#exec MESH SEQUENCE MESH=Enforcer SEQ=All               STARTFRAME=0  
 
NUMFRAMES=69
#exec MESH SEQUENCE MESH=Enforcer SEQ=Idle1           STARTFRAME=24 
 
NUMFRAMES=2  RATE=1
#exec MESH SEQUENCE MESH=Enforcer SEQ=Idle2          STARTFRAME=0  
 
NUMFRAMES=2  RATE=1
#exec MESH SEQUENCE MESH=Enforcer SEQ=shoot          STARTFRAME=26 
 
NUMFRAMES=9  RATE=15
#exec MESH SEQUENCE MESH=Enforcer SEQ=Reload            STARTFRAME=74 
 
NUMFRAMES=19 RATE=16
#exec MESH SEQUENCE MESH=Enforcer SEQ=ReloadStart       STARTFRAME=74 
 
NUMFRAMES=10 RATE=16
#exec MESH SEQUENCE MESH=Enforcer SEQ=ReloadEnd         STARTFRAME=84 
 
NUMFRAMES=9  RATE=16
#exec MESH SEQUENCE MESH=Enforcer SEQ=Down              STARTFRAME=34 
 
NUMFRAMES=8  RATE=16
#exec MESH SEQUENCE MESH=Enforcer SEQ=Select            STARTFRAME=41 
 
NUMFRAMES=9  RATE=16 GROUP=Select
 
 as a breakdown the SEQ is the sequence that you are refering to,these are the things that
 
differ from Unreal and DX. so in DX use the ones I have listed.
 
All,Idle1,Idle2,Shoot,ReloadStart,Reload,ReloadEnd,Down and Select. the Startframe is
 
where the animator started the specific animation and the NumFrames is the number of
 
frames that animation is. Rate is how fast the animation goes and the Group is same as
 
Sequence.Keep it in mind you are responsible for tweaking these and it is trial and error
 
with most of it.
 
Now for the texture import that is easy.All you do is import the textures and assign them
 
to the meshmap.
 
#exec TEXTURE IMPORT NAME=ENF1Skin FILE=Models\EN1Skin.PCX GROUP=Skins
#exec TEXTURE IMPORT NAME=ENF2Skin FILE=Models\EN2Skin.PCX GROUP=Skins
 

#exec MESHMAP SETTEXTURE MESHMAP=Enforcer NUM=0
 
TEXTURE=WeaponHandsTex
#exec MESHMAP SETTEXTURE MESHMAP=Enforcer NUM=1 TEXTURE=ENF1Skin
#exec MESHMAP SETTEXTURE MESHMAP=Enforcer NUM=2 TEXTURE=ENF2Skin
 
ok I'll break this down now. you import the texture by it's name in your "models" or
 
"textures" folder. and you give it a name then you set which "multiskins" get's the texture.
 
num=0 is always the hands in DX then 1 and 2 are the textures you set for your gun.Again
 
this is trial and error. Note that I named the texture's ENF1Skin and ENF2Skin in stead of
 
EN1Skin or EN2Skin as they are named in their pcx format.That is because once it is
 
imported by the part of the statement "FILE=Models\EN1Skin.PCX GROUP=Skins" you
 
can name it whatever you choose here "TEXTURE IMPORT NAME=ENF1Skin" but it is
 
usually best to keep the names the same.I just wanted you to understand how it is done.
 

 Well that should be about all there is to importing a weapon form another Unreal based
 
game into Deus-ex.So take your time have fun and enjoy ;)
 

 OH and here is whole syntax so you have a template
 
//==============================================================
 
===============
// WeaponMYCRUD.
//==============================================================
 
===============
class WeaponMYCRUD extends DeusExWeapon;
 
var() somevariable;
var() whatever;
 
// player view version
#exec MESH IMPORT MESH=MYCRUD ANIVFILE=MODELS\MYCRUD_a.3d
 
DATAFILE=MODELS\MYCRUD_d.3d X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=MYCRUD X=0 Y=0 Z=0 pitch=0 yaw=0 roll=0
 
#exec MESH SEQUENCE MESH=MYCRUD SEQ=All               STARTFRAME=0  
 
NUMFRAMES=69
#exec MESH SEQUENCE MESH=MYCRUD SEQ=Idle1           STARTFRAME=24 
 
NUMFRAMES=2  RATE=1
#exec MESH SEQUENCE MESH=MYCRUD SEQ=Idle2          STARTFRAME=0  
 
NUMFRAMES=2  RATE=1
#exec MESH SEQUENCE MESH=MYCRUD SEQ=shoot          STARTFRAME=26 
 
NUMFRAMES=9  RATE=15
#exec MESH SEQUENCE MESH=MYCRUD SEQ=Reload            STARTFRAME=74 
 
NUMFRAMES=19 RATE=16
#exec MESH SEQUENCE MESH=MYCRUD SEQ=ReloadStart       STARTFRAME=74 
 
NUMFRAMES=10 RATE=16
#exec MESH SEQUENCE MESH=MYCRUD SEQ=ReloadEnd         STARTFRAME=84 
 
NUMFRAMES=9  RATE=16
#exec MESH SEQUENCE MESH=MYCRUD SEQ=Down              STARTFRAME=34 
 
NUMFRAMES=8  RATE=16
#exec MESH SEQUENCE MESH=MYCRUD SEQ=Select            STARTFRAME=41 
 
NUMFRAMES=9  RATE=16 GROUP=Select
 
#exec TEXTURE IMPORT NAME=MYCRUD1Skin FILE=textures\MYCRUD1Skin.PCX
 
GROUP=Skins
#exec TEXTURE IMPORT NAME=MYCRUD2Skin FILE=textures\MYCRUD2Skin.PCX
 
GROUP=Skins
 
#exec MESHMAP NEW   MESHMAP=MYCRUD MESH=MYCRUD
#exec MESHMAP SCALE MESHMAP=MYCRUD X=0.2050 Y=0.2050 Z=0.2
 
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUD NUM=0
 
TEXTURE=WeaponHandsTex
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUD NUM=1
 
TEXTURE=MYCRUD1Skin
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUD NUM=2
 
TEXTURE=MYCRUD2Skin
 

#exec AUDIO IMPORT FILE="Sounds\MYCRUD_fire.wav" NAME="MYCRUD_fire"
#exec AUDIO IMPORT FILE="Sounds\MYCRUD_select.wav" NAME="MYCRUD_select"
#exec AUDIO IMPORT FILE="Sounds\MYCRUD_reload.wav"
 
NAME="MYCRUD_reload"
 
// pickup version
#exec MESH IMPORT MESH=MYCRUDPickup
 
ANIVFILE=MODELS\MYCRUDPickup_a.3D
 
DATAFILE=MODELS\MYCRUDPickup_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=MYCRUDPickup X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
#exec MESH SEQUENCE MESH=MYCRUDPickup SEQ=All  STARTFRAME=0 
 
NUMFRAMES=1
#exec MESHMAP SCALE MESHMAP=MYCRUDPickup X=0.113 Y=0.113 Z=0.126
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUDPickup NUM=0
 
TEXTURE=MYCRUD1Skin
#exec MESHMAP SETTEXTURE MESHMAP=LMYCRUDPickup NUM=1
 
TEXTURE=MYCRUD2Skin
 
// 3rd person perspective version
#exec MESH IMPORT MESH=MYCRUDHand
 
ANIVFILE=MODELS\MYCRUDHand_a.3D DATAFILE=MODELS\MYCRUDHand_d.3D
 
X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=MYCRUDHand X=0 Y=0 Z=0 YAW=128 PITCH=-8 ROLL=0
#exec MESH SEQUENCE MESH=MYCRUDHand SEQ=All  STARTFRAME=0 
 
NUMFRAMES=1
#exec MESHMAP SCALE MESHMAP=MYCRUDHand X=0.092 Y=0.092 Z=0.092
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUDHand NUM=0
 
TEXTURE=MYCRUD1Skin
#exec MESHMAP SETTEXTURE MESHMAP=MYCRUDHand NUM=1
 
TEXTURE=MYCRUD2Skin
 
 
 
Don't forget each thing you put is your own,you must study the code of the original UT or
 
whatever mesh,then accordingly edit your DX one.
 

     Hope this all helped you.
 
 
 
            GEIST